<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>后台管理中心</title>
        <?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>
        <script type="text/javascript">
            $(function(){
                //颜色插件
                $("#bn").bigColorpicker("color");
                
                
                $("#myform").validate({
                    rules: {
                        name: "required",
                        en_name:"required",
                        <?php if ($this->_var['data']['icon'] == ''): ?>
                        icon:"required",
                        <?php endif; ?>
                        star_num:{
                            number:true,
                            max:10
                        },
                        experience:'required'
                    },
                    messages: {
                        name: "用户组的名称不能为空",
                        en_name:"英文名称不能为空",
                        icon:"ICON不能为空",
                        star_num:{
                            number:"星数必须为数字",
                            max:'必须为0-10的数字'
                        },
                        experience:"经验数不能为空"
                    }
                });
            })
        </script>
    </head>
    <body>
        <?php echo $this->fetch('message.html'); ?>
        <div class="pad-10">
            <div class="common-form">
                <form name="myform" action="#" method="post" id="myform" enctype="MULTIPART/FORM-DATA" >
                    <fieldset>
                        <legend>基本信息</legend>
                        <table width="100%" class="table_form">
                            <tr>
                                <td width="80"  class="red">用户组名</td> 
                                <td><input type="text" name="name"  class="input-text" id="name" size="50" value="<?php echo $this->_var['data']['name']; ?>"></input></td>
                            </tr>
                            
                              <tr>
                                <td width="80"  class="red">英文名</td> 
                                <input type="hidden" value="<?php echo $this->_var['data']['en_name']; ?>" name="en_name"/>
                                <td><input type="text" name="en_name2"  class="input-text" id="en_name" size="50" value="<?php echo $this->_var['data']['en_name']; ?>" <?php if ($this->_var['data']['en_name'] == 'youke_user'): ?>disabled<?php endif; ?>></input><?php if ($this->_var['data']['en_name'] == 'youke_user'): ?>游客的此字段不能修改<?php endif; ?></td>
                            </tr>

                            <tr>
                                <td width="80"  class="red">经验数</td> 
                                <td><input type="text" name="experience"  class="input-text" id="experience" size="20" value="<?php echo $this->_var['data']['experience']; ?>"></input></td>
                            </tr>

                            <tr>
                                <td width="80">星级数量</td> 
                                <td><input type="text" name="star_num"  class="input-text" id="star_num" size="20" value="<?php echo $this->_var['data']['star_num']; ?>"></input></td>
                            </tr>
                            
                            
                            
                            <tr>
                                <td>
                                    是否禁用
                                </td>
                                <td>
                                    <label style="width:88px"><input type="radio" value="1"  name="active" <?php if ($this->_var['data']['active'] == 1): ?>checked="checked"<?php endif; ?>> 是 </label>
                                    <label style="width:88px"><input type="radio" value="0"   name="active" <?php if ($this->_var['data']['active'] == 0): ?>checked="checked"<?php endif; ?>> 否 </label>
                                </td> 
                            </tr>

                            <tr>
                                <td width="80">用户名颜色</td> 
                                <td>	
                                    <input type="text" name="color" value="<?php echo $this->_var['data']['color']; ?>"  class="input-text color" id="color" size="10"></input>
                                    <input id="bn" type="button" value="选色" />
                                </td>
                            </tr>

                            <tr>
                                <td  class="red">图标</td> 
                                <td><input type="file" name="icon" id="icon" />&nbsp;&nbsp;<img src="<?php echo $this->_var['data']['icon']; ?>" width="50" height="50" style="border:1px solid #ccc;"></td>
                            </tr>
                            <tr>
                                <td>描述</td> 
                                <td> <textarea  style="width:50%;height:46px;"  name="description"><?php echo $this->_var['data']['description']; ?></textarea></td>
                            </tr>

                            <tr>
                                <td>权限设置</td>
                                <td>
                                    <?php if (count ( $this->_var['privilege_list'] ) > 0): ?>
                                    <?php $_from = $this->_var['privilege_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
                                    <div style="border-bottom: 1px solid #ccc"> 
                                        <p style="margin: 5px 0 5px 0;"> <input type="checkbox" name="privilege_id[]" value="<?php echo $this->_var['list']['id']; ?>" id="privilege_<?php echo $this->_var['list']['id']; ?>" <?php if (in_array ( $this->_var['list']['id'] , $this->_var['data']['privilege_list'] )): ?>checked='true'<?php endif; ?>/><label for="privilege_<?php echo $this->_var['list']['id']; ?>"><?php echo __($this->_var['list']['name']); ?></label></p>
                                        <div id="privilege_sub_<?php echo $this->_var['list']['id']; ?>">
                                        <?php if (count ( $this->_var['list']['children'] ) > 0): ?>
                                        <?php $_from = $this->_var['list']['children']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'children');if (count($_from)):
    foreach ($_from AS $this->_var['children']):
?>
                                        <input type="checkbox" name="privilege_id[]" value="<?php echo $this->_var['children']['id']; ?>" id="privilege_<?php echo $this->_var['children']['id']; ?>" <?php if (in_array ( $this->_var['children']['id'] , $this->_var['data']['privilege_list'] )): ?>checked='true'<?php endif; ?> /><label for="privilege_<?php echo $this->_var['children']['id']; ?>"><?php echo __($this->_var['children']['name']); ?></label>
                                        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                        <?php endif; ?>
                                        </div>
                                    </div>
                                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                                    <?php endif; ?>
                                </td>
                            </tr>
                            <tr>
                                <td>排序</td>
                                <td>
                                    <input type="text" name="position" class="input-text" size="10" value="<?php echo $this->_var['data']['position']; ?>"></input>
                                </td>
                            </tr>
                            <tr align="center">
                                <td colspan="2">
                                    <input type="submit" value="提交" name="dosubmit" class="button">
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>
        </div>


    </body>
</html>